/**
 * ProductFee 业务逻辑实现类
 * @author yanwl
 * @date 2014-09-03
 */
package com.chnbst.bstyun.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.chnbst.bstyun.core.base.BaseService;
import com.chnbst.bstyun.core.common.helper.DaoHelper;
import com.chnbst.bstyun.model.pojo.ProductFee;
import com.chnbst.bstyun.model.vo.ProductFeeVo;
import com.chnbst.bstyun.service.ProductFeeService;

@Transactional
@Service
public class ProductFeeServiceImpl extends BaseService implements ProductFeeService {
	
	private final static String nameSpace = "com.chnbst.bstyun.mapper.ProductFeeMapper";
	
	@Transactional(propagation=Propagation.REQUIRED,readOnly=false)
	@Override
	public boolean deleteProductFee(Integer productFeeId) {
		return DaoHelper.delete(nameSpace, "deleteProductFee", productFeeId);
	}
	
	@Transactional(propagation=Propagation.REQUIRED,readOnly=false)
	@Override
	public boolean insertProductFee(ProductFee productFee) {
		return DaoHelper.insert(nameSpace, "insertProductFee", productFee);
	}
	
	@Transactional(propagation=Propagation.REQUIRED,readOnly=false)
	@Override
	public boolean updateProductFee(ProductFee productFee) {
		return DaoHelper.update(nameSpace, "updateProductFee", productFee);
	}
	
	@Transactional(propagation=Propagation.REQUIRED,readOnly=true)
	@Override
	public ProductFee selectProductFeeByProductFeeId(Integer productFeeId) {
		return (ProductFee)DaoHelper.query(nameSpace, "selectProductFeeByProductFeeId", productFeeId);
	}
	
	@SuppressWarnings("unchecked")
	@Transactional(propagation=Propagation.REQUIRED,readOnly=true)
	@Override
	public List<ProductFee> selectProductFees(Map<String, Object> map) {
		return (List<ProductFee>)DaoHelper.list(nameSpace, "selectProductFees", map);
	}

	@Transactional(propagation=Propagation.REQUIRED,readOnly=true)
	@Override
	public ProductFee selectProductFeeByProductId(Integer productId) {
		return (ProductFee)DaoHelper.query(nameSpace, "selectProductFeeByProductId", productId);
	}

	@Transactional(propagation=Propagation.REQUIRED,readOnly=true)
	@Override
	public ProductFeeVo selectProductFeeVoByProductId(Integer productId) {
		return (ProductFeeVo)DaoHelper.query(nameSpace, "selectProductFeeVoByProductId", productId);
	}
}
